/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.annuaireComp.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author MiniK
 */
@Embeddable
public class CompetencePersonnelPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "idcompetence")
    private int idcompetence;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idpersonnel")
    private int idpersonnel;

    public CompetencePersonnelPK() {
    }

    public CompetencePersonnelPK(int idcompetence, int idpersonnel) {
        this.idcompetence = idcompetence;
        this.idpersonnel = idpersonnel;
    }

    public int getIdcompetence() {
        return idcompetence;
    }

    public void setIdcompetence(int idcompetence) {
        this.idcompetence = idcompetence;
    }

    public int getIdpersonnel() {
        return idpersonnel;
    }

    public void setIdpersonnel(int idpersonnel) {
        this.idpersonnel = idpersonnel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idcompetence;
        hash += (int) idpersonnel;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompetencePersonnelPK)) {
            return false;
        }
        CompetencePersonnelPK other = (CompetencePersonnelPK) object;
        if (this.idcompetence != other.idcompetence) {
            return false;
        }
        if (this.idpersonnel != other.idpersonnel) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.annuaireComp.entities.CompetencePersonnelPK[ idcompetence=" + idcompetence + ", idpersonnel=" + idpersonnel + " ]";
    }
    
}
